package com.masblearn;

public class BulletWallColider implements Colider {
    @Override
    public boolean colider(GameObject o1, GameObject o2) {
        if(o1 instanceof Bullet && o2 instanceof  Wall){
                Bullet b = (Bullet) o1;
                Wall w = (Wall) o2;

                if(b.rect.intersects(w.rectangle)){
                    b.die();
                }
        }else  if(o2 instanceof Bullet && o1 instanceof  Wall){
            colider(o2,o1);
        }
        return true;
    }
}
